Don't replace ot_lfree and stuff yet though...to much code churn.
--- /dev/null
+[submodule "src/libgsystem"]
+ path = src/libgsystem
+ url = git://git.gnome.org/libgsystem
src/daemon/ot-daemon.c \
$(NULL)
-ostreed_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree -I$(srcdir)/src/daemon -DLOCALEDIR=\"$(datadir)/locale\" $(OT_INTERNAL_GIO_UNIX_CFLAGS)
+ostreed_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/src/libgsystem -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree -I$(srcdir)/src/daemon -DLOCALEDIR=\"$(datadir)/locale\" $(OT_INTERNAL_GIO_UNIX_CFLAGS)
ostreed_LDADD = libotutil.la libostree.la $(OT_INTERNAL_GIO_UNIX_LIBS)
$(NULL)
endif
-libostree_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree -DLOCALEDIR=\"$(datadir)/locale\" $(OT_INTERNAL_GIO_UNIX_CFLAGS)
+libostree_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/src/libgsystem -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree -DLOCALEDIR=\"$(datadir)/locale\" $(OT_INTERNAL_GIO_UNIX_CFLAGS)
libostree_la_LDFLAGS = -avoid-version -Bsymbolic-functions
libostree_la_LIBADD = libotutil.la $(OT_INTERNAL_GIO_UNIX_LIBS)
src/ostadmin/ot-admin-main.c \
$(NULL)
-ostadmin_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree -I$(srcdir)/src/ostadmin -DLOCALEDIR=\"$(datadir)/locale\" $(OT_INTERNAL_GIO_UNIX_CFLAGS)
-ostadmin_LDADD = libotutil.la libostree.la $(OT_INTERNAL_GIO_UNIX_LIBS)
+ostadmin_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/src/libgsystem -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree -I$(srcdir)/src/ostadmin -DLOCALEDIR=\"$(datadir)/locale\" $(OT_INTERNAL_GIO_UNIX_CFLAGS)
+ostadmin_LDADD = libgsystem.la libotutil.la libostree.la $(OT_INTERNAL_GIO_UNIX_LIBS)
src/ostree/ot-main.c \
$(NULL)
-ostree_bin_shared_cflags = $(AM_CFLAGS) -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree -I$(srcdir)/src/ostree -DLOCALEDIR=\"$(datadir)/locale\"
+ostree_bin_shared_cflags = $(AM_CFLAGS) -I$(srcdir)/src/libgsystem -I$(srcdir)/src/libotutil -I$(srcdir)/src/libostree -I$(srcdir)/src/ostree -DLOCALEDIR=\"$(datadir)/locale\"
ostree_bin_shared_ldadd = libotutil.la libostree.la
ostree_CFLAGS = $(ostree_bin_shared_cflags) $(OT_INTERNAL_GIO_UNIX_CFLAGS)
libotutil_la_SOURCES = \
src/libotutil/ot-checksum-utils.c \
src/libotutil/ot-checksum-utils.h \
- src/libotutil/ot-local-alloc.c \
src/libotutil/ot-local-alloc.h \
src/libotutil/ot-opt-utils.c \
src/libotutil/ot-opt-utils.h \
src/libotutil/otutil.c \
src/libotutil/otutil.h \
$(NULL)
-libotutil_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/src/libotutil -DLOCALEDIR=\"$(datadir)/locale\" $(OT_INTERNAL_GIO_UNIX_CFLAGS)
-libotutil_la_LIBADD = $(OT_INTERNAL_GIO_UNIX_LIBS)
+libotutil_la_CFLAGS = $(AM_CFLAGS) -I$(srcdir)/src/libgsystem -I$(srcdir)/src/libotutil -DLOCALEDIR=\"$(datadir)/locale\" $(OT_INTERNAL_GIO_UNIX_CFLAGS)
+libotutil_la_LIBADD = $(OT_INTERNAL_GIO_UNIX_LIBS) libgsystem.la
OT_INTERNAL_SOUP_LIBS = $(OT_DEP_SOUP_LIBS)
endif
+libgsystem_srcpath := src/libgsystem
+libgsystem_cflags = $(OT_INTERNAL_GIO_UNIX_CFLAGS)
+libgsystem_libs = $(OT_INTERNAL_GIO_UNIX_LIBS)
+include src/libgsystem/Makefile-libgsystem.am
include Makefile-daemon.am
include Makefile-otutil.am
include Makefile-libostree.am
--- /dev/null
+Subproject commit ba5d74802c0ffe51bd18d2ba64db87e1e7456349
+++ /dev/null
-/* -*- mode: C; c-file-style: "gnu"; indent-tabs-mode: nil; -*-
- *
- * Copyright (C) 2012 Colin Walters <walters@verbum.org>
- *
- * This library is free software; you can redistribute it and/or
- * modify it under the terms of the GNU Lesser General Public
- * License as published by the Free Software Foundation; either
- * version 2 of the License, or (at your option) any later version.
- *
- * This library is distributed in the hope that it will be useful,
- * but WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
- * Lesser General Public License for more details.
- *
- * You should have received a copy of the GNU Lesser General Public
- * License along with this library; if not, write to the
- * Free Software Foundation, Inc., 59 Temple Place - Suite 330,
- * Boston, MA 02111-1307, USA.
- *
- * Author: Colin Walters <walters@verbum.org>
- */
-
-#include "config.h"
-
-#include "otutil.h"
-
-void
-ot_local_free (void *loc)
-{
- void **location = loc;
- if (location)
- g_free (*location);
-}
-
-#define _ot_local_free(type, function) do { \
- void **location = loc; \
- if (location) \
- { \
- type *value = *location; \
- if (value) \
- function (value); \
- } \
- } while (0)
-
-void
-ot_local_obj_unref (void *loc)
-{
- GObject **location = (GObject**)loc;
- if (location && *location)
- g_object_unref (*location);
-}
-
-void
-ot_local_variant_unref (GVariant **loc)
-{
- if (loc && *loc)
- g_variant_unref (*loc);
-}
-
-void
-ot_local_ptrarray_unref (GPtrArray **loc)
-{
- if (loc && *loc)
- g_ptr_array_unref (*loc);
-}
-
-void
-ot_local_hashtable_unref (GHashTable **loc)
-{
- if (loc && *loc)
- g_hash_table_unref (*loc);
-}
#define __OSTREE_LOCAL_ALLOC_H__
#include <gio/gio.h>
+#include "libgsystem.h"
G_BEGIN_DECLS
-void ot_local_free (void *loc);
-void ot_local_obj_unref (void *loc);
-void ot_local_variant_unref (GVariant **loc);
-void ot_local_ptrarray_unref (GPtrArray **loc);
-void ot_local_hashtable_unref (GHashTable **loc);
-
-#define ot_lfree __attribute__ ((cleanup(ot_local_free)))
-#define ot_lobj __attribute__ ((cleanup(ot_local_obj_unref)))
-#define ot_lvariant __attribute__ ((cleanup(ot_local_variant_unref)))
-#define ot_lptrarray __attribute__ ((cleanup(ot_local_ptrarray_unref)))
-#define ot_lhash __attribute__ ((cleanup(ot_local_hashtable_unref)))
+#define ot_lfree __attribute__ ((cleanup(gs_local_free)))
+#define ot_lobj __attribute__ ((cleanup(gs_local_obj_unref)))
+#define ot_lvariant __attribute__ ((cleanup(gs_local_variant_unref)))
+#define ot_lptrarray __attribute__ ((cleanup(gs_local_ptrarray_unref)))
+#define ot_lhash __attribute__ ((cleanup(gs_local_hashtable_unref)))
G_END_DECLS